/**	CODE EVAL::Easy [Word To Digit]
 *	Having string representation of a set of numbers, print them in numeric value.
 *	
 *	Solution by Michael Pio Arroyo
 */

#include <iostream>
#include <fstream>
#include <string>

void Read(std::string a_line);
void PrintNum(std::string s);

int main(int argc, char** argv) {
	std::ifstream file;
	std::string line;
	file.open(argv[1]);

	while(getline(file, line)) {
		Read(line);
		putchar('\n');
	}

	file.close();
	return 0;
}

void Read(std::string a_line) {
	std::string::iterator it = a_line.begin();
	std::string t;
	do{
		while(*it != ';') {
			t.push_back(*it);
			++it;
			if(it == a_line.end())
				break;
		}
		PrintNum(t);
		t.clear();
		if(it == a_line.end())
				break;
		++it;
	}while(it != a_line.end());
}

void PrintNum(std::string s) {
	if(s == "zero")
		std::cout << 0;
	if(s == "one")
		std::cout << 1;
	if(s == "two")
		std::cout << 2;
	if(s == "three")
		std::cout << 3;
	if(s == "four")
		std::cout << 4;
	if(s == "five")
		std::cout << 5;
	if(s == "six")
		std::cout << 6;
	if(s == "seven")
		std::cout << 7;
	if(s == "eight")
		std::cout << 8;
	if(s == "nine")
		std::cout << 9;
}